package com.cws.project.cws.signinstudent.service.impl;

import java.util.List;

import com.cws.common.utils.DateUtils;
import com.cws.common.utils.text.Convert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cws.project.cws.signinstudent.mapper.SignInStudentMapper;
import com.cws.project.cws.signinstudent.domain.SignInStudent;
import com.cws.project.cws.signinstudent.service.ISignInStudentService;

/**
 * 学生签到记录Service业务层处理
 *
 * @author xyl
 * @date 2022-03-27
 */
@Service
public class SignInStudentServiceImpl implements ISignInStudentService {
    @Autowired
    private SignInStudentMapper signInStudentMapper;

    /**
     * 查询学生签到记录
     *
     * @param signInId 学生签到记录ID
     * @return 学生签到记录
     */
    @Override
    public SignInStudent selectSignInStudentById(Long signInId) {
        return signInStudentMapper.selectSignInStudentById(signInId);
    }

    /**
     * 查询学生签到记录列表
     *
     * @param signInStudent 学生签到记录
     * @return 学生签到记录
     */
    @Override
    public List<SignInStudent> selectSignInStudentList(SignInStudent signInStudent) {
        return signInStudentMapper.selectSignInStudentList(signInStudent);
    }

    /**
     * 新增学生签到记录
     *
     * @param signInStudent 学生签到记录
     * @return 结果
     */
    @Override
    public int insertSignInStudent(SignInStudent signInStudent) {
        signInStudent.setSignInTime(DateUtils.getNowDate());
        return signInStudentMapper.insertSignInStudent(signInStudent);
    }

    /**
     * 修改学生签到记录
     *
     * @param signInStudent 学生签到记录
     * @return 结果
     */
    @Override
    public int updateSignInStudent(SignInStudent signInStudent) {
        return signInStudentMapper.updateSignInStudent(signInStudent);
    }

    /**
     * 删除学生签到记录对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSignInStudentByIds(String ids) {
        return signInStudentMapper.deleteSignInStudentByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除学生签到记录信息
     *
     * @param signInId 学生签到记录ID
     * @return 结果
     */
    @Override
    public int deleteSignInStudentById(Long signInId) {
        return signInStudentMapper.deleteSignInStudentById(signInId);
    }

    @Override
    public SignInStudent selectSignInStudent(SignInStudent signInStudent) {
        return signInStudentMapper.selectSignInStudent(signInStudent);
    }
}
